package gridmath;

import preprocessing.WindowingSystem;
import datastructures.UserParameters;

public class ExpectedControlsCalculator extends CaseMatrixBase {

	private final int Controls;
//	private final double penetrance;
	
	public ExpectedControlsCalculator(UserParameters userparams, WindowingSystem windowmaker) {
		super(windowmaker, userparams.getMaxorder());
		Controls = userparams.getNumber_of_controls();
//		penetrance = userparams.getPenetrance();
		
		specialTypeOfOperation = MatrixOperations.calculateExpectedControls;	//this is an ExpectedControl calculator
		specialTypeOfOperand = MatrixOperations.calculateFrequency;	//expects frequency matrix
	}
	
	@Override
	public double doOperation (double expectedCarrierFreq) {
		//double effectiveControlFreq = expectedCarrierFreq*(1-penetrance);
		double effectiveControlFreq = expectedCarrierFreq;
		return Math.round(Controls * effectiveControlFreq);
	}

}
